package com.yunxiangyue.room_login_info

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.Query
import androidx.room.Update


@Dao
interface LogDao {

    @Insert
    fun inserInfo(lofInfo: LogInfo):Long

    @Update
    fun updateInfo(newInfo: LogInfo)

    @Query("select * from LogInfo")
    fun queryAllInfo():List<LogInfo>

    @Query("select * from LogInfo where phone=:phone")
    fun queryByPhone(phone:String):Int

    @Query("select * from LogInfo where phone like :phone")
    fun queryByPhone_List(phone: String):List<LogInfo>

    @Query("delete from LogInfo where phone=:phone")
    fun deleteByPhone(phone:String):Int

    @Delete
    fun deleteInfo(lofInfo: LogInfo):Int



    @Query("delete from LogInfo")
    fun deleteAll():Int

}